package com.toubutu.audio.dto;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.toubutu.audio.common.QueryBaseDto;
import com.toubutu.audio.entity.Comment;
import com.toubutu.constants.BaseConstants;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author 朱鹏杰
 * @version 1.0
 * @date 2024年02月28日 19:44
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class UserCommentDto extends QueryBaseDto<Comment> {

    @NotNull(message = "用户id不能为空!")
    private Long userId;
    @Override
    public LambdaQueryWrapper<Comment> getWrapper() {
        LambdaQueryWrapper<Comment> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Comment::getUserId,userId);
        wrapper.eq(Comment::getIsDelete, BaseConstants.UN_DELETED);
        return wrapper;
    }


}
